from PyQt5.Qt import *
import sys

"""
图标、标题、透明度、窗口状态、最大化最小化、窗口标志

"""
class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("窗口讲解")
        self.resize(600,400)
        icon = QIcon('icon.png')
        self.setWindowIcon(icon)
        self.setWindowOpacity(0.9)

        """
        WindowMaximizeButtonHint
        WindowCloseButtonHint
        FramelessWindowHint
        CustomizeWindowHint
        """
        self.setWindowFlags(Qt.CustomizeWindowHint)

        """
        # 窗口状态
        # WindowNoState
        # WindowMinimized
        # WindowMaximized
        # WindowFullScreen
        # WindowActive
        
        """

        # self.setWindowState(Qt.WindowFullScreen)

    def showEvent(self, QShowEvent):
        print('窗口显示')
    def resizeEvent(self, QResizeEvent):
        print(self.size())
    def closeEvent(self,QCloseEvent):
        print('窗口关闭')
    def moveEvent(self, QMoveEvent):
        print(self.x(),self.y())


if __name__=='__main__':
    app = QApplication(sys.argv)
    w = Window()
    w.show()
    sys.exit(app.exec_())